<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../include.jsp" %>


<html>
<head>
	<!-- jquery uploader -->
	<script src="/scripts/jquery-uploader/ajaxUploader/ajaxupload.js" type="text/javascript"></script>
	
	<script type="text/javascript" src="/scripts/custom/member/thumbnailUploadManager.js"></script>	
	<script type="text/javascript" src="/scripts/custom/member/history.js"></script>
	<script type="text/javascript">
	var $ = jQuery.noConflict();
	
	$(document).ready(function() {
		
		// 이력정보 자동조회
		fnLoadHistory();
		
		// 이미지 업로드 자동조회
		fnLoadThumbnail("${userId}");
		
		// 이미지 업로드 컴포넌트 초기화
		new AjaxUpload($("#atchBtn"), {
			action: "/member/thumbnail/upload",
			name: "attachFile",
			responseType: "json",
			onSubmit: function(fileName, ext) {
				var isPass = fnCallbackSubmit(fileName, ext);
				if (isPass == false) return false;
				this.disable();
			},
			onComplete: function(fileName, response) {
				this.enable();	
				if (response.success == true) {
					fnCallbackComplete(fileName, response);
				} else {
					fnCallbackCompleteFail(fileName, response);
				}
			}
		});

		// 이력정보 입력
		$("#id_btn_comment_add").click(function(e) { 
			e.preventDefault();
			fnSaveHistory();
		});
		
	});
	</script>
</head>
<body>

	<h3><sec:authentication property="principal.user.name"/>님의 이력 조회</h3>

	<table width="100%" cellspacing="0" cellpadding="0">
		<col width="120">
		<col width="10">
		<col>
		<tr>
			<td valign="top">
			
			
				<!-- 사진 업로드 폼 -->
				<div class="tbl_type1">
					<table> 
						<tr> 
							<td height=150>
								<span id="id_div_myImage"><img src="/member/thumbnail/download/EXT/0000/FILE/no_user_image" width="120" height="150"></span>
							</td>
						</tr>
						</tr>
							<td>
								<!-- 파일첨부 버튼 -->	
								<div class="atchUpperDiv">
									<div>
										<a onClick="return;" class='btn_s08'>
											<span class='l'></span>
											<span class='c'>
												<span class='gray01' style='font-size:11px;letter-spacing:-1px'>
													<div id="atchBtn">사진등록</div>
												</span>
											</span>
											<span class='r'></span>
										</a>
									</div>											
									<div class="atchFileSzDiv">
										(<span id="id_div_fileSumSize">0 Bytes</span>)
									</div>
								</div>							
							</td>
						</tr>
					</table>
				</div>	
				
				
			</td>
			<td>&nbsp;</td>
			<td valign="top">
			
			
				<!-- 이력 등록 폼 -->
				<div class="tbl_type1">
					<table id="id_tbl_save_comment" cellspacing="0" > 
						<col>
						<col width="20">
						<tr> 
							<td colspan="2" style='text-align:left;'>
								<sec:authentication property="principal.user.name"/> (<sec:authentication property="principal.user.nickname"/>)
							</td>
						</tr>
						<tr id="id_loading_comment"> 
							<td colspan="2"><img src="/img/ajax-loader.gif"></td>
						</tr>
						<tr>
							<td style="text-align:left;" colspan="2">
								<textarea id="id_textarea_comment" cols=90 rows=2></textarea>&nbsp;&nbsp;
								<input type="image" id="id_btn_comment_add" src="/img/btn_memo.gif" >
							</td>
						</tr>
					</table>
				</div>
				
							
			</td>
		</tr>
	</table>

	
</body>
</html>